//
//  PricvacyViewController.m
//  Shoes365
//
//  Created by CJX on 16/8/30.
//  Copyright © 2016年 Shanghai DuRui Information Technology Company. All rights reserved.
//

#import "PricvacyViewController.h"

@interface PricvacyViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,copy) NSString * str;
@end

@implementation PricvacyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.automaticallyAdjustsScrollViewInsets = NO;
    [self makeNaviButton];
    [self makeView];
}
-(void)makeView{
    _str = @"Privacy Policy\n\nFor users logging on to the site to be personally identifiable,the following information is collected and stored.\nWhen you register on our website or through other company’s products or services,or visit the company website,the site will collect your personal information,including name,photo number,zip code and address.\n\nThe Bank will automatically receive and record your browser and the server log information,including but not limited to your IP address ,cookie information in this site,and your web history requirements.\n\nThe use and production of information\n\nThe company will collect the contents of the information mentioned above.The company might use some of the pictures you will uploads on Shein.com and share them on our various social media accounts.\n\n\nCustomer information held by the company is confidential ,except:\n\n1.When the company has your consent to share the information;\n2.When disclosing your personal information to provide you with requested products and services;\n3.According to legal requirements,the company has the authority to make law or comply with legal directives,but the company will provide the appropriate jurisdiction;\n4.In case of emergency,to safeguard the interests of users and the public;\n5.In the case that the other companies need to open,edit or disclose personal information in the situation.The revised privacy policy website reserves the right to make changes;\n\nChoice and Opt-Out\n\nIf you no longer wish to receive the Company’s promotional communications,you may “opt-out “of receiving them by following the instruction included in each communication or by e-mailing the Company at Uggboxservice@hotmail.com.\n\nWhen you register,you will be given the option to opt-out of subscribing to our regular update service.If you are subscribed to our update service,we will send you email alerts for new products,features,enhancements,special offers,contests,events of interest and one-off marketing promotions.\n\nAt all times,we will offer you the opportunity to unsubscribe out of any service or update to which you have subscribed,if you change your mind.Any email we send you will contain an easy automated unsubscribe link so that you can opt-out of that subscription. Simply follow the indications in the email.\n\n";
    self.view.backgroundColor=[UIColor whiteColor];
    
    
    
    UITableView * tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight) style:UITableViewStylePlain];
    tableView.delegate = self;
    tableView.dataSource = self;
    
    [self.view addSubview:tableView];
    
    
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        
        //        cell.textLabel.text = _str;
        //        cell.textLabel.numberOfLines = 0;
        //
        
        
    }
    UILabel *contactLabel=[[UILabel alloc]init];
    contactLabel.text=_str;
    contactLabel.font = [UIFont systemFontOfSize:14];
    contactLabel.numberOfLines=0;
    [cell addSubview:contactLabel];
    if (KScreenWidth == 320) {
        contactLabel.frame = CGRectMake(20, 5, KScreenWidth-40, 568 + 900);
    }else if(KScreenWidth >320&& KScreenWidth < 400){
        contactLabel.frame = CGRectMake(20, 5, KScreenWidth-40, KScreenHeight+650);
    }
    else{
        contactLabel.frame = CGRectMake(20, 0, KScreenWidth-40, KScreenHeight+500);
    }
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (KScreenWidth == 320) {
        return 568 + 800;
    }else if(KScreenWidth >320&& KScreenWidth < 400){
        return KScreenHeight + 550;
    }else{
        return KScreenHeight + 410;
    }
//    if (KScreenWidth == 320) {
//        return 568 + 1710;
//    }else if(KScreenWidth >320&& KScreenWidth < 400){
//        return KScreenHeight + 650;
//    }else{
//        return KScreenHeight + 1010;
//    }
}
-(void)makeNaviButton{
    
    self.title=@"PRICVACY POLICY";
    
    UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
    
    [leftButton setBackgroundImage:[UIImage imageNamed:@"nav_back"] forState:0];
    
    leftButton.frame=CGRectMake(0, 0, ACTUAL_WIDTH(23), ACTUAL_HEIGHT(23));
    
    [leftButton addTarget:self action:@selector(comeBack) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem*item= [[UIBarButtonItem alloc]initWithCustomView:leftButton];
    
    self.navigationItem.leftBarButtonItem=item;
}
#pragma mark 返回事件
-(void)comeBack{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
